package com.api.demo.mapper;

import com.api.demo.entity.ContentLike;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ContentLikeMapper extends BaseMapper<ContentLike> {
    @Select("SELECT * FROM content_like WHERE user_id = #{userId} AND content_id = #{contentId} LIMIT 1")
    ContentLike findByUserIdAndContentId(
            @Param("userId") Long userId,
            @Param("contentId") Long contentId);
}